﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Faker {
    public static class Faker {
        public static string Numerify(string numberFormat) {
            var regex = new Regex("#");
            return regex.Replace(numberFormat, m => RandomNumber().ToString());
        }

        public static string Letterify(string stringFormat) {
            var regex = new Regex(@"\?");
            return regex.Replace(stringFormat, m => RandomLetter());
        }

        public static string Bothify(string format) {
            return Letterify(Numerify(format));
        }

        private static int RandomNumber() {
            var r = new Random();
            return r.Next(10);
        }

        private static string RandomLetter() {
            var r = new Random();
            return ((char) r.Next((int) 'a', (int) 'z')).ToString();
        }
    }
}
